<template>
    <a href="/vm1"><h1>vm1</h1></a>
    <div id="main"></div>
</template>
<script>
import *  as  echarts from 'echarts'
import  data from './vmdata'

export default {
    name: 'Vm',
    mounted() {
        let myecharts = document.getElementById('main')
            let myChart = echarts.init(document.getElementById('main'),null,{
                width: 600,
                height: 400
            })
            myChart.setOption({
                title: {
                    text: 'ECharts 入门示例'
                },
                tooltip: {},
                legend: {
                    data: ['第一季度','第二季度']
                },
                xAxis: {
                    data: ["衬衫", "羊毛衫", "雪纺衫", "裤子","高跟鞋", "袜子"]
                },
                seriesIndex: 0, 
                yAxis: {},
                series: [{
                    name: '第一季度',
                    type: 'bar',
                    data: [5, 20, 36, 10, 10, 20]
                },
                {
                    name: '第二季度',
                    type: 'bar',
                    data: [15, 20, 46, 1, 10, 20]
                }
            ],
                visualMap: {
                    show: true,
                    type: 'continuous',
                    seriesIndex: 0,
                    min: 0,
                    max: 50,
                    inRange: {
                        color: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']   
                    }
                },
            })   
    }
}
</script>
<style scoped>

</style>